package es.us.isa.jdbl.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.SecondaryTable;
import javax.persistence.SecondaryTables;
import javax.persistence.Table;

@Entity
@SecondaryTables({
	@SecondaryTable(name="content_type_research_lines", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
	@SecondaryTable(name="content_field_acronym", catalog = "webisa", pkJoinColumns={
			@PrimaryKeyJoinColumn(name="nid", referencedColumnName="nid")}),
})
@DiscriminatorValue("research_lines")
public class ResearchLine extends AbstractNode{	
	@Column(name="field_acronym_value",table="content_field_acronym")
	private String acronym;
	@ManyToMany
	@JoinTable(name="content_field_user", catalog = "webisa",
			joinColumns=@JoinColumn(name="nid"),
			inverseJoinColumns=@JoinColumn(name="field_user_uid", referencedColumnName="uid"))
	private List<Member> researchStaff;

	public String getAcronym() {
		return acronym;
	}

	public void setAcronym(String acronym) {
		this.acronym = acronym;
	}

	public List<Member> getResearchStaff() {
		return researchStaff;
	}

	public void setResearchStaff(List<Member> researchStaff) {
		this.researchStaff = researchStaff;
	}	
}
